<div class="main-box-info tb-imte">
	<table class="mem-biao" id="commissionChange">
		<thead>
			<tr>
				<th colspan="7"><span>时间：</span> <input
					class="layriqi starTime" type="text"
					onclick="laydate({format:'YYYY-MM-DD',isclear:false});"
					readonly="true"> <span class="zhi">至</span> <input
					class="layriqi endTime" type="text"
					onclick="laydate({format:'YYYY-MM-DD',isclear:false});"
					readonly="true"> <span>账变类型：</span> <select
					class="sourceModule"> 
						<option value="BETTING_REBATE">返点</option> 
				</select> <a href="javascript:;" class="butsty1">查询</a></th>
			</tr>
		</thead>
	</table>
	<table class="mem-biao" style="width: 100%">
		<tbody>
			<tr>
			    <th>帐变时间</th>
				<th>用户名</th>
				<th>帐变类型</th>
				<th>单号</th>
				<th>游戏</th>
				<th>玩法</th>
				<th>期号</th>
				<th>模式</th>
				<th>帐变资金</th>
				<th>余额</th>
			</tr>
		</tbody>
		<tbody id="commissionChange-data">
		</tbody>
	</table>
</div>

<script type="text/javascript">
	$(function() {
		$("#commissionChange .starTime").val(laydate.now(-3));
		$("#commissionChange .endTime").val(laydate.now(1)); 
		$("#commissionChange .butsty1").livequery("click",commissionChangeList);
		$("#commissionChange .butsty1").trigger('click'); 
	});
	
	//获取订单信息（不包括追号订单）
	function commissionChangeList() {
		var starTime = $("#commissionChange .starTime").val();
		var endTime = $("#commissionChange .endTime").val();
	    if (dateDiff(starTime, endTime) < 0) {
			popTips('查询结束日期要大于开始日期', 'error');
			return false;
		} 
		var pagination = $.pagination({
			render : '.paging',
			pageSize : 10,
			pageLength : 3,
			ajaxType : 'get',
			hideInfos : false,
			hideGo : true,
			ajaxUrl : '/user/pagingCommission',
			ajaxData : { 
				"startDate" : starTime,
				"endDate" : endTime, 
				"accountType" : $("#sourceModule").val()
			//是否是追号 0不是追号 1追号
			},
			success : function(data) {
				$("#commissionChange-data").html(
						_.template($('#commissionChange_template').html(), {
							items : data
						}));
			}
		});
		pagination.init();
	}
</script>


<script type="text/html" id="commissionChange_template">
 	<%_.each(items,function(item,index) {%>
		<tr>
			<td><%=item.actionDate%></td>
			<td><%=item.uname %></td>
			<td><%=item.accountType %></td>
			<td><%=item.coinOrder %></td>
			<td><%=item.lotteryName %></td>
			<td><%=item.playName %></td>
	        <td><%=item.lotteryNo %></td>
			<td>
				<%if(item.betsMode==2.00){%> 元 <%}%>
				<%if(item.betsMode==0.20){%> 角 <%}%>
				<%if(item.betsMode==0.02){%> 分 <%}%>
		        <%if(item.betsMode==0.002){%> 厘 <%}%>
			</td>
			<td><%=item.coin.toFixed(4)%></td>
			<td><%=item.usercoin.toFixed(4) %></td> 
			
		</tr>
	<%})%>
</script>